﻿
using System;


namespace PuertsStaticWrap
{
    public static class System_Threading_Tasks_ConcurrentExclusiveSchedulerPair_Wrap
    {
        
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8ConstructorCallback))]
        private static IntPtr Constructor(IntPtr isolate, IntPtr info, int paramLen, long data)
        {
            try
            {
                
                if (paramLen == 0)
                {
                    
                    
                    
                    
                    {
                        
                        var result = new System.Threading.Tasks.ConcurrentExclusiveSchedulerPair();
                        
                        
                        return Puerts.Utils.GetObjectPtr((int)data, typeof(System.Threading.Tasks.ConcurrentExclusiveSchedulerPair), result);
                    }
                }
                
                if (paramLen == 1)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.TaskScheduler), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Threading.Tasks.TaskScheduler>(false);
                        var result = new System.Threading.Tasks.ConcurrentExclusiveSchedulerPair(Arg0);
                        
                        
                        return Puerts.Utils.GetObjectPtr((int)data, typeof(System.Threading.Tasks.ConcurrentExclusiveSchedulerPair), result);
                    }
                }
                
                if (paramLen == 2)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.TaskScheduler), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.Number, null, false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Threading.Tasks.TaskScheduler>(false);
                        var Arg1 = argHelper1.GetInt32(false);
                        var result = new System.Threading.Tasks.ConcurrentExclusiveSchedulerPair(Arg0,Arg1);
                        
                        
                        return Puerts.Utils.GetObjectPtr((int)data, typeof(System.Threading.Tasks.ConcurrentExclusiveSchedulerPair), result);
                    }
                }
                
                if (paramLen == 3)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    var argHelper2 = new Puerts.ArgumentHelper((int)data, isolate, info, 2);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.TaskScheduler), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.Number, null, false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.Number, null, false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Threading.Tasks.TaskScheduler>(false);
                        var Arg1 = argHelper1.GetInt32(false);
                        var Arg2 = argHelper2.GetInt32(false);
                        var result = new System.Threading.Tasks.ConcurrentExclusiveSchedulerPair(Arg0,Arg1,Arg2);
                        
                        
                        return Puerts.Utils.GetObjectPtr((int)data, typeof(System.Threading.Tasks.ConcurrentExclusiveSchedulerPair), result);
                    }
                }
                
                Puerts.PuertsDLL.ThrowException(isolate, "invalid arguments to System.Threading.Tasks.ConcurrentExclusiveSchedulerPair constructor");
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
            return IntPtr.Zero;
        }
        
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        private static void M_Complete(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
                var obj = Puerts.Utils.GetSelf((int)data, self) as System.Threading.Tasks.ConcurrentExclusiveSchedulerPair;
                
                
                {
                    
                    
                    
                    
                    {
                        
                        obj.Complete();
                        
                        
                        
                        
                    }
                }
                
                
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }
        
        
        
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        private static void G_Completion(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
                var obj = Puerts.Utils.GetSelf((int)data, self) as System.Threading.Tasks.ConcurrentExclusiveSchedulerPair;
                var result = obj.Completion;
                Puerts.ResultHelper.Set((int)data, isolate, info, result);
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }
        
        
        
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        private static void G_ConcurrentScheduler(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
                var obj = Puerts.Utils.GetSelf((int)data, self) as System.Threading.Tasks.ConcurrentExclusiveSchedulerPair;
                var result = obj.ConcurrentScheduler;
                Puerts.ResultHelper.Set((int)data, isolate, info, result);
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }
        
        
        
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        private static void G_ExclusiveScheduler(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
                var obj = Puerts.Utils.GetSelf((int)data, self) as System.Threading.Tasks.ConcurrentExclusiveSchedulerPair;
                var result = obj.ExclusiveScheduler;
                Puerts.ResultHelper.Set((int)data, isolate, info, result);
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }
        
        
        
        
        
        public static Puerts.TypeRegisterInfo GetRegisterInfo()
        {
            return new Puerts.TypeRegisterInfo()
            {
                BlittableCopy = false,
                Constructor = Constructor,
                Methods = new System.Collections.Generic.Dictionary<Puerts.MethodKey, Puerts.V8FunctionCallback>()
                {
                    { new Puerts.MethodKey {Name = "Complete", IsStatic = false},  M_Complete },
                    
                },
                Properties = new System.Collections.Generic.Dictionary<string, Puerts.PropertyRegisterInfo>()
                {
                    {"Completion", new Puerts.PropertyRegisterInfo(){ IsStatic = false, Getter = G_Completion, Setter = null} },
                    {"ConcurrentScheduler", new Puerts.PropertyRegisterInfo(){ IsStatic = false, Getter = G_ConcurrentScheduler, Setter = null} },
                    {"ExclusiveScheduler", new Puerts.PropertyRegisterInfo(){ IsStatic = false, Getter = G_ExclusiveScheduler, Setter = null} },
                    
                }
            };
        }
        
    }
}